<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>取消默认动作</title>
</head>
<body>
	<h1>取消默认动作</h1><hr>
	请点击<a id="mylink" href="">此链接</a>
	<script type="text/javascript">
		function killClicks(event) {
			event.preventDefault();
		}
		document.addEventListener("click", killClicks, true);
		document.getElementById("mylink").onclick = function() {
			alert("单击事件");
		}
	</script>
</body>
</html>